package t;

class Fish{
   int weight;
}
class Lake{
   Fish fish;
   void setFish(Fish s){
      fish = s;
   }
   void eat(int n){
      fish.weight = fish.weight + n;
   }
}
class FishandLake{
   public static void main(String[] args) {
      Fish niqiu = new Fish();
      System.out.println(niqiu.weight);//输出1
      Lake taihu  = new Lake();
      Lake yangchenghu = new Lake();
      Lake qinghu = new Lake();
      taihu.setFish(niqiu);
      taihu.eat(15);
      yangchenghu.setFish(niqiu);
      yangchenghu.eat(13);
      qinghu.setFish(niqiu);
      qinghu.eat(9);
      System.out.println(niqiu.weight);//输出2
      System.out.println(taihu.fish.weight);//输出3
      System.out.println(yangchenghu.fish.weight);
      System.out.println(qinghu.fish.weight);
   }
}



